-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable account #344
base: main
Are you sure you want to change the base?
Disable account #344
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #344 +/- ##
==========================================
+ Coverage 78.30% 78.32% +0.01%
==========================================
Files 78 80 +2
Lines 5435 5467 +32
==========================================
+ Hits 4256 4282 +26
- Misses 1179 1185 +6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice module!
.vscode/settings.json
Outdated
"python.testing.pytestArgs": ["tests"], | ||
"python.testing.pytestArgs": [ | ||
"." | ||
], | ||
"python.testing.unittestEnabled": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be changed?
app/endpoints/auth.py
Outdated
if not user.enabled: | ||
raise HTTPException( | ||
status_code=status.HTTP_401_UNAUTHORIZED, | ||
detail="Disabled account. Contact eclair@myecl.fr for more informations.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to hard code an email in the API response?
app/endpoints/external_account.py
Outdated
@router.get( | ||
"/external/", | ||
status_code=200, | ||
tags=[Tags.external_account], | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could put the endpoint in users.py
app/models/models_core.py
Outdated
@@ -35,6 +35,7 @@ class CoreUser(Base): | |||
phone: Mapped[str | None] = mapped_column(String) | |||
floor: Mapped[FloorsType] = mapped_column(Enum(FloorsType), nullable=False) | |||
created_on: Mapped[datetime | None] = mapped_column(DateTime(timezone=True)) | |||
enabled: Mapped[bool] = mapped_column(Boolean, nullable=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of disabled
?
Description
I created code to be able to delete accounts that do not have a Central address.
To do that, I :
I still have to exclude deactivated CoreUsers from the search